package com.example.demo.service;

import com.example.demo.dao.commodity;
import com.example.demo.dao.user;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface commodityService {

    List<commodity> getCommodityByCommodityName(String commodityName);

    List<commodity> getCommodityByUserName(String userName);

    List<commodity> getCommodityAll();

    commodity getCommodityById(long commodityId);

    commodity addCommodity (commodity commodity);

    commodity updateCommoditySold(Long commodityIds,int commodityOnSale, int commoditySold);

    @Modifying
    @Transactional
    void delcommodityById(long commodityId);
}
